package com.wxx;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
//        SharesEntity entity = new SharesEntity();
//        entity.code = "asd";
//        entity.url = "asd";
//        entity.name = "asd";
//        entity.price = "asd";
//        SharesDbManager.getSharesMapper().insert(entity);
//        System.getProperties().setProperty("webdriver.chrome.driver", System.getProperty("user.dir") + "/src/main/res/chromedriver");
//        WebDriver webDriver = new ChromeDriver();
//        webDriver.get("http://www.baidu.com");
        System.out.println(System.getProperties().getProperty("os.name"));
        String driverPath = "";
        if (System.getProperties().getProperty("os.name").contains("Mac")) {
            driverPath = System.getProperty("user.dir") + "/src/main/resources/chromedriver";
        } else {
            driverPath = System.getProperty("user.dir") + "/src/main/resources/chromedriver.exe";
        }
        System.out.println("文件的路径：" + driverPath);
        System.getProperties().setProperty("webdriver.chrome.driver", driverPath);

        ChromeDriver webDriver = new ChromeDriver();
        webDriver.get("http://www.baidu.com");
    }
}
